var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
    })(e, t);
}, function(e, t) {
    function n() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, 
    new n());
}), a = this && this.__decorate || function(e, t, o, n) {
    var i, r = arguments.length, a = r < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, o) : n;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) a = Reflect.decorate(e, t, o, n); else for (var s = e.length - 1; 0 <= s; s--) (i = e[s]) && (a = (r < 3 ? i(a) : 3 < r ? i(t, o, a) : i(t, o)) || a);
    return 3 < r && a && Object.defineProperty(t, o, a), a;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("GameData"), s = e("UIManager"), c = e("Global"), l = e("PopItemView"), d = cc._decorator, u = d.ccclass, p = d.property, h = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.moneyLabel = null, e.diamondLabel = null, e.pieceLabel = null, e.money = 0, 
        e.diamond = 0, e.piece = 0, e;
    }
    return i(e, t), e.prototype.onClick = function(e) {
        e = e.target;
        e instanceof cc.Node && (r.GD.isChristmasReward = 1, 0 == (e = e.getSiblingIndex()) ? (r.GD.money += this.money, 
        s.default.getInstance().showToast({
            money: this.money
        })) : 1 == e ? (r.GD.diamond += this.diamond, s.default.getInstance().showToast({
            diamond: this.diamond
        })) : 2 == e && (r.GD.piece += this.piece, s.default.getInstance().showToast({
            piece: this.piece
        })), this.hidePnl());
    }, e.prototype.onLoad = function() {
        this.money = .1 * c.G.getPrice(r.GD.topRank), this.diamond = 200, this.piece = 50;
    }, e.prototype.callback = function() {
        r.GD.isChristmasReward = 1, r.GD.money += this.money, r.GD.diamond += this.diamond, 
        r.GD.piece += this.piece, s.default.getInstance().showToast({
            money: this.money,
            diamond: this.diamond,
            piece: this.piece
        }), this.hidePnl();
    }, e.prototype.start = function() {
        this.refresh(), t.prototype.start.call(this);
    }, e.prototype.refresh = function() {
        this.moneyLabel.string = GA.formatNumber(this.money), this.diamondLabel.string = this.diamond.toString(), 
        this.pieceLabel.string = this.piece.toString();
    }, a([ p(cc.Label) ], e.prototype, "moneyLabel", void 0), a([ p(cc.Label) ], e.prototype, "diamondLabel", void 0), 
    a([ p(cc.Label) ], e.prototype, "pieceLabel", void 0), a([ u ], e);
}(l.default);

n.default = h;